package com.itfs.strategy;

public class StrategyFactoryTest {
    public static void main(String[] args) {
        //将年会员策略对应的key传入
        String strategyKey = "Year";
        //工厂通过策略key获取对应的策略实例
        DiscountStrategy discountStrategy = StrategyFactory.getDiscountStrategy(strategyKey);
        Consumer consumer = new Consumer(discountStrategy);
        consumer.execute();
    }
}